#include "config.h"


Config::Config(QString fileName, QObject *parent) : QObject(parent)
{
    settings = new QSettings(fileName.append(".ini"), QSettings::IniFormat);
}

Config::~Config()
{
    delete settings;
}

void Config::writeConfig(const QString &group, const QString &key, const QVariant &value)
{
    settings->beginGroup(group);
    settings->setValue(key, value);
    settings->endGroup();
}

QVariant Config::readConfig(const QString &group, const QString &key)
{
    QString path = QString("%1/%2").arg(group).arg(key);
    return settings->value(path);
}
